#include "widget.h"
#include "ui_widget.h"
#include <QAndroidJniObject>
#include <QAndroidJniEnvironment>

Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::on_pushButton_clicked()
{
   /* QAndroidJniObject::callObjectMethod("com/amap/location/demo/MainActivity"
                                        "init");*/
/*
    QAndroidJniObject thread =
               QAndroidJniObject::callStaticObjectMethod(
                    "java/lang/Thread", "currentThread",
                     "()Ljava/lang/Thread;");*/

    /*QAndroidJniObject value = QAndroidJniObject::callStaticMethod("com/amap/location/demo/MainActivity", "send_data");

    ui->label->setText(value.toString());*/

    QAndroidJniObject string = QAndroidJniObject::callStaticObjectMethod<jstring>("com/amap/location/demo/MainActivity", "send_data");

    QString qstring = string.toString();

    ui->label->setText(qstring);
}
